package com.mapforge.plugin;

import java.util.ArrayList;
import java.util.List;

public class PluginManager {
	private List<Plugin> plugins;
	private List<String> knownPlugins;

	private static PluginManager pluginManager;

	private PluginManager() {
		// TODO load some file with know plugins
		this.knownPlugins = null;
		plugins = new ArrayList<Plugin>();
		loadKnownPlugins();
	}

	public static PluginManager getHandle() {
		return pluginManager == null ? (pluginManager = new PluginManager())
				: pluginManager;
	}

	public List<Plugin> getPlugins() {
		return plugins;
	}

	public void installNewPlugin(Plugin plugin, String pluginPath) {

	}

	public void loadPlugin(Plugin plugin) {

	}

	private void loadKnownPlugins() {

	}

	public boolean pluginExists(String pluginName) {
		return knownPlugins.contains(pluginName);
	}
}
